import { IFeidaoAiBrowserComponent } from "@feidao/web/interfaces";
import Select from "@feidao/widgets/fd-w000005";

export default async function a002(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="select-id"]').value;
	if (!v) {
		alert('请输入要选中的值');
	} else {
		const select = fd.data.node.querySelector<Select>('[data-feidao-id="fd-w000005-001"]');
		select.value = v;
	}

	fd.data.node.querySelector<HTMLAreaElement>('[data-feidao-id="fd-w000005-003"]').innerHTML = `
const v = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="select-id"]').value;
if (!v) {
	alert('请输入要选中的值');
} else {
	const select = fd.data.node.querySelector<Select>('[data-feidao-id="fd-w000005-001"]');
	select.value = v;
}
	`;
}
